<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>遍历对象</title>
</head>

<body>
    <div id="app">
        <ul>
            <!-- 前面是val,后面是key,第三个参数是index,项目中使用的很少 -->
            <li v-for="val,key in user" :key="key">{{key}}---{{val}}</li>
        </ul>
    </div>

    <script src="../vue/vue.js"></script>
    <script>
        const app = new Vue({
            el: '#app',
            data: {
                user: {
                    header: 'img',
                    name: 'spa',
                    age: 18
                }

            }
        });
    </script>
</body>

</html>l